package com.hqyj.controller;


import com.hqyj.pojo.Exam;
import com.hqyj.pojo.Student;
import com.hqyj.service.IExamService;
import com.hqyj.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author rock
 * @since 2021-11-15
 */
@RestController
@RequestMapping("/student")
public class StudentController {
    @Autowired
    private IStudentService studentService;
    //加载表格数据
    @GetMapping(value = "/list")
    public  HashMap<String,Object> listPage(Student student){

        return studentService.select(student);

    }
    @PostMapping(value = "/add")
    public HashMap<String,Object> add(Student student){

        return studentService.add(student);
    }

    @PostMapping(value = "/update")
    public HashMap<String ,Object> update(Student student){
        return studentService.update(student);
    }

    @PostMapping("/del")
    public HashMap<String ,Object> del(Integer studentId){
        return studentService.del(studentId);
    }


}

